package designPatterns_demo.strategy_pattern.demo2;

public class Price {
	// 持有一个具体的策略对象
	private MemberStrategy memberStrategy;
	
	/**
     * 构造函数，传入一个具体的策略对象
     * @param strategy    具体的策略对象
     */
	public Price(MemberStrategy memberStrategy) {
		this.memberStrategy = memberStrategy;
	}
	
	 /**
     * 计算图书的价格
     * @param booksPrice    图书的原价
     * @return    计算出打折后的价格
     */
	public double quote(double bookPrice) {
		return this.memberStrategy.calcPrice(bookPrice);
	}
}
